﻿@model IEnumerable<AuctionDataLayer.Notification>
@{
    ViewBag.Title = "Notifications";
}           

<div class="page">
    <h2>Notifications</h2>
    @Html.ActionLink("Back", "Index", "Dashboard", null, new { @class = "subpage-back", title = "Back" })
    @foreach (var item in Model)
    {
        <section class="notification-item black-shadow-box">
            <div class="left-container col"> 
                <aside class="notification-title">@item.Message
                    <span>for @item.Bid.Group.Name</span>
                    @if(item.Accepted == true)
                    {
                        <span class="nofification-item-state-accepted"></span>
                    }
                    else
                    {
                        <span class="nofification-item-state-declined"></span>
                    }
                </aside>
            </div>            
            <div class="right-container col">
                <aside class="notification-bid ">
                    <p><span class="bid-info-title">Date:</span>@item.Bid.Date.ToLongDateString()</p>
                    <p><span class="bid-info-title">Time:</span>@item.Bid.StartTime.ToShortTimeString() to @item.Bid.EndTime.ToShortTimeString() </p>
                    @if (item.Bid.AnyRoom == true)
                    {
                        <p><span class="bid-info-title">Room:</span>Any</p>
                    }
                    else
                    {
                        <p><span class="bid-info-title">Room:</span>@item.Bid.Room.Name</p>
                    }                   
                    @if (item.Bid.StateId == 3)
                    {  
                        <p>Bidding amount has been repaid</p>                                                   
                    }
                    else
                    { 
                        <p><span class="bid-info-title">Paid amount:</span>@item.Bid.PaidAmount credits</p>
                    }
                    <aside class="remove-notification">
                        @Html.ActionLink("Delete", "DeleteNotification", new { id = item.Id }, new { @class = "remove-notification", title = "Remove Notification" })
                    </aside> 
                </aside>           
            </div>
        </section>
    }
</div>